package com.phy.gsjl.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author curry
 * 用户实体类
 */
@Entity
@Table(name = "user")
public class User {
	
	/**
	 * 用户名， 主键
	 */
	@Id
	@Column(name = "username", nullable = false, unique = true)
	private String username;
	
	/**
	 * 用户密码
	 */
	@Column(name = "password", nullable = false)
	private String password;

	/**
	 * 用户真实姓名
	 */
	@Column(name = "realname", nullable = false)
	private String realname;
	
	/**
	 * 用户所在部门
	 */
	@Column(name = "department", nullable = false)
	private String department;
	
	/**
	 * 用户角色:总经理，管理员，普通员工
	 */
	@Column(name = "role", nullable = false)
	private String role;

	
	public User() {

	}
	
	public User(String username, String password, String realname, String department, String role) {
		this.username = username;
		this.password = password;
		this.realname = realname;
		this.department = department;
		this.role = role;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@Override
	public String toString() {
		return "User [username=" + username + ", password=" + password + ", realname=" + realname + ", department="
				+ department + ", role=" + role + "]";
	}

}
